import { defineStore } from 'pinia'

//状态管理 存储jwt
export const useJwtStore = defineStore('jwt', {
  state: () => ({ jwt: '' }),
  getters: {
    getJwt: (state) => state.jwt,
  },
  actions: {
    updateJwt(jwtStr: string) {
      this.jwt = jwtStr
    },
    clearJwt() {
      this.jwt = ''
    }
  },
})
